home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / var / lib / python-support / python2.6 / orca / phonnames.pyc (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2009-04-20  |  1.6 KB  |  38 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. '''Provides getPhoneticName method that maps each letter of the
  5. alphabet into its localized phonetic equivalent.'''
  6. __id__ = '$Id: phonnames.py 3882 2008-05-07 18:22:10Z richb $'
  7. __version__ = '$Revision: 3882 $'
  8. __date__ = '$Date: 2008-05-07 14:22:10 -0400 (Wed, 07 May 2008) $'
  9. __copyright__ = 'Copyright (c) 2006-2008 Sun Microsystems Inc.'
  10. __license__ = 'LGPL'
  11. from orca_i18n import _
  12. __phonlist = _('a : alpha, b : bravo, c : charlie, d : delta, e : echo, f : foxtrot, g : golf, h : hotel, i : india, j : juliet, k : kilo, l : lima, m : mike, n : november, o : oscar, p : papa, q : quebec, r : romeo, s : sierra, t : tango, u : uniform, v : victor, w : whiskey, x : xray, y : yankee, z : zulu')
  13. __phonnames = { }
  14. for __pair in __phonlist.split(','):
  15.     __w = __pair.split(':')
  16.     __phonnames[__w[0].strip()] = __w[1].strip()
  17.  
  18.  
  19. def getPhoneticName(character):
  20.     """Given a character, return its phonetic name, which is typically
  21.     the 'military' term used for the character.
  22.  
  23.     Arguments:
  24.     - character: the character to get the military name for
  25.  
  26.     Returns a string representing the military name for the character
  27.     """
  28.     if isinstance(character, unicode):
  29.         character = character.encode('UTF-8')
  30.     
  31.     
  32.     try:
  33.         return __phonnames[character]
  34.     except:
  35.         return character
  36.  
  37.  
  38.